package com.hangzhou.welbeing.welbeinginstrument.factory;

import android.support.v4.app.Fragment;

import com.hangzhou.welbeing.welbeinginstrument.fragement.releaseFindFragment;
import com.hangzhou.welbeing.welbeinginstrument.fragement.releasePayAttentionToFragment;

import java.util.HashMap;

/**
 * 杭州惟君医疗科技有限公司18
 * Created by 20433 on 2018/1/31
 */

public class CircleFragmentFactory {
    private static final int FIND = 0;
    private static final int ATTENTION = 1; //Attention
    private static HashMap<Integer, Fragment> mapAllCircle = new HashMap();

    public static Fragment CreateCircleObject(int position) {
        Fragment fragment = mapAllCircle.get(position);
        if (fragment == null) {
            switch (position) {
                case FIND:
                    fragment = new releaseFindFragment();
                    break;
                case ATTENTION:
                    fragment = new releasePayAttentionToFragment();
                    break;
            }
            mapAllCircle.put(position, fragment);
            return fragment;
        }
        return fragment;
    }
}
